package demo06_Builder.model;

public class Direct {

    private PlayBuilder playBuilder;

    public Direct(PlayBuilder playBuilder) {
        this.playBuilder = playBuilder;
    }


    public Player build() {
        if(playBuilder.hasBar()) {
            playBuilder.buildBar();
        }
        if(playBuilder.hasMenu()) {
            playBuilder.bulidMenu();
        }
        if(playBuilder.hasWindow()) {
            playBuilder.bulidWindow();
        }
        if(playBuilder.hasList()) {
            playBuilder.bulidList();
        }
        if(playBuilder.hasCollection()) {
            playBuilder.buildCollection();
        }

        return playBuilder.build();
    }
}
